package com.miao.controller
{
	import com.miao.model.ConfigProxy;
	import com.miao.utils.Consts;
	import com.miao.view.DownLoadManagerMediator;
	import com.miao.view.FlvPlayerMediator;
	import com.miao.view.ResourceTreeMediator;
	import com.miao.view.SwfPlayerMediator;
	import com.miao.view.WindowEventMediator;
	import com.miao.view.WindowMenuMediator;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	public class StartUpCommand extends SimpleCommand
	{
		
		override public function execute(note:INotification):void{
			var player:StudyPlayer = note.getBody() as StudyPlayer;
			
			facade.registerMediator(new WindowMenuMediator(player));
			facade.registerMediator(new WindowEventMediator(player));
			facade.registerMediator(new ResourceTreeMediator(player.tree));
			facade.registerMediator(new SwfPlayerMediator(player.swfPlayer));
			facade.registerMediator(new FlvPlayerMediator(player.flvPlayer));
			facade.registerMediator(new DownLoadManagerMediator());
			
			facade.registerProxy(new ConfigProxy());
			
			sendNotification(Consts.LOAD_CONFIG);
		}
		
	}
}